package Hot100.Easy.LC104;


import Hot100.Easy.LC101.LC101;

/**
 * 二叉树的最大深度
 */

public class LC104 {
    public static void main(String[] args){
        TreeNode root=new TreeNode(1);
        root.left=new TreeNode(2);
        root.right=new TreeNode(2);
        root.left.left=new TreeNode(3);
        root.left.right=new TreeNode(4);
        root.right.left=new TreeNode(4);
        root.right.right=new TreeNode(3);
        LC104 solution = new LC104();
        System.out.println(solution.maxDepth(root));

    }
    
     public int maxDepth(TreeNode root) {
         if (root == null) return 0;
            return Math.max(maxDepth(root.left), maxDepth(root.right)) + 1;
        }


}
